<template>
    <div id="app" v-loading="loading">
        <div class="title">系统模板</div>
        <el-row class="tableBtnTop">
            <div class="search" style="margin-left:0;">
            <el-input placeholder="请输入模板名称"
                v-model="searchText"
                @keyup.enter.native="searchWill"
            >
                <i slot="prefix" class="el-input__icon el-icon-search"></i>
            </el-input>
            </div>
            <el-button class="f1" @click="$router.push('/task/systemTemplateDetail/')">添加模板</el-button>
        </el-row>
        <el-table :data="tableData" border>
            <el-table-column prop="name" label="模板名称" :show-overflow-tooltip="true"></el-table-column>
            <el-table-column prop="count_use" label="被绑定个数" :show-overflow-tooltip="true"></el-table-column>
            <el-table-column prop="time_created" label="更新时间" :show-overflow-tooltip="true">
                <template slot-scope="scope">
                    <div>
                        {{
                            scope.row.time_created ? 
                            countTrialDate(scope.row.time_created * 1000) : 
                            '-'
                        }}
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="btn" label="操作" :show-overflow-tooltip="true">
            <template slot-scope="scope">
                <div class="tableBtn">
                    <router-link class="blue" :to="'/task/systemTemplateDetail?id='+ scope.row.id ">查看</router-link>
                    <el-popconfirm title="真的要删除这条信息吗?"
                        @onConfirm="deleteWayType(scope.$index)"
                    >
                        <a class="gray" slot="reference">删除</a>
                    </el-popconfirm>
                </div>
            </template>
            </el-table-column>
        </el-table>
        <div class="paginationBlock">
            <el-pagination layout="prev, pager, next,total" 
                :total="listNumsTotal" 
                :page-size="10"
                @current-change="changePage"
            >
            </el-pagination>
        </div>
    </div>
</template>

<script>
    import SystemTemplateList from './index.js';
    export default SystemTemplateList;
</script>
<style lang="scss" scoped>
    .title{
        margin-bottom:25px;
        font-size:21px;
        margin-top:65px;
    }
</style>